public class MyDay {
    public int year;
    public int month;
    public int day;

    public void setDate(int year, int month, int day) {
//        year = y;
//        month = m;
//        day=d;
//
        this.year = year;
        this.month = month;
        this.day = day;


    }
//    public void printDate(){
//        System.out.println(year + "年" + month + "月" + day+"日");
//        this.test();
//    }
//
//    public void test(){
//        System.out.println("测试调用");
//    }


    public MyDay() {
        this(2000,1,1);
        System.out.println("无参数的构造方法");
    }

    public MyDay(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("带三个参数的构造方法");
    }

    public void printDate(){
        System.out.println(year + "年" + month + "月" + day+"日");
    }

    @Override
    public String toString() {
        return "MyDay{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }
}
